{#login/templates/login/index.html#}

{% extends 'base.html' %}
{% block title %}主页{% endblock %}
{% block css %}<link rel="stylesheet" href="/static/css/index.css">
<link rel="stylesheet" href="/static/css/entry-f3121f603b4ede1d27bc.css">
                {% endblock %}

{% block content %}

<div class="container index">
{# {% if request.session.is_login %}#}
{##}
{#    {% else %}#}
{#    <h1>你尚未登录，只能访问公开内容！</h1>#}
{#    {% endif %}#}
<div class="row">
    <div class="col-xs-16 main">
        <div class="split-line"></div>
        <div class="list-container">
            <ul class="note-list">
                {% for d in lists %}
                <li>
                    <div class="content">

                        <a class="title" target="_blank" href="/detail/{{ d.id }}">{{ d.title }}</a>
                        <p class="abstract">{{ d.abstract }}</p>
                        <div class="meta">

                            <a class="nickname" target="_blank">{{ d.author }}</a>
                            <a target="_blank">
                            <i class="iconfont ic-list-comments"></i>
                                {{ d.reply_num }}
                            </a>

                            <span>
                                <i class="iconfont ic-list-like"></i>
                                {{ d.like_num }}
                            </span>

                        </div>

                    </div>
                </li>
                {% endfor %}
            </ul>

        <a href="{{ page_index }}" class="load_more" >阅读更多</a>
        </div>

    </div>
{#<div class="col-xs-7 col-xs-offset-1 aside">#}
    <div class="col-xs-7 col-xs-offset-1 aside">
      <div class="board">
        <a target="_blank" href="/mobile/club"><img src="/static/images/banner-s-club-aa8bdf19f8cf729a759da42e4a96f366.png" alt="Banner s club"></a>
        <a utm_medium="index-banner-s" target="_blank" href="/mobile/books?category_id=284"><img src="/static/images/banner-s-7-1a0222c91694a1f38e610be4bf9669be.png" alt="Banner s 7"></a>
        <a utm_medium="index-banner-s" target="_blank" href="/publications"><img src="/static/images/banner-s-5-4ba25cf5041931a0ed2062828b4064cb.png" alt="Banner s 5"></a>
        <a target="_blank" href="/c/e048f1a72e3d?utm_medium=index-banner-s&amp;utm_source=desktop"><img src="/static/images/banner-s-6-c4d6335bfd688f2ca1115b42b04c28a7.png" alt="Banner s 6"></a>
      </div>

      <!-- 首页右侧 App 下载提示 -->
      <a id="index-aside-download-qrbox" class="col-xs-8 download" data-toggle="popover" data-placement="top" data-html="true" data-trigger="hover" data-content="<img src=&quot;//cdn2.jianshu.io/assets/web/download-index-side-qrcode-4130a7a6521701c4cb520ee6997d5fdb.png&quot; alt=&quot;Download index side qrcode&quot; />" href="/apps?utm_medium=desktop&amp;utm_source=index-aside-click" data-original-title="" title="">
        <img class="qrcode" src="/static/images/download-index-side-qrcode-4130a7a6521701c4cb520ee6997d5fdb.png" alt="Download index side qrcode">
        <div class="info">
          <div class="title">下载简书手机App<i class="iconfont ic-link"></i></div>
          <div class="description">随时随地发现和创作内容</div>
        </div>
      </a>

    </div>


</div>
</div>


{% endblock %}
<script type="text/javascript">
    $(function () {
        $(".load_more").click(function (e) {
            e.preventDefault()
            page_index =$(this).attr("href")
            $.ajax({
                url:"/index_more?page_index="+page_index,
                success:function (data) {
                    d=$.parseJSON(data)
                    if (d.status=="no")
                        return false
                    $(".load_more").attr("href",d.pageindex)
                    for (var i=0;i<d["data"].length;i++){
                        var title = d.data[i].title
                        var id = d.data[i].id
                        var author = d.data[i].author
                        var abstract = d.data[i].abstract
                        var reply_num = d.data[i].reply_num
                        var read_num = d.data[i].read_num
                        var like_num = d.data[i].like_num

                        htmlStr+='<div class="content"><a class="title" target="_blank" href'
                        htmlStr+='"/detail/'+id+'">'+title+'</a>'
                        htmlStr+='<p class="abstract">'+'abstract'+'</p>'
                        htmlStr+=' <div class="meta">\n'
                        htmlStr+='<a class="nickname" target="_bank">'+author+'</a>'
                        htmlStr+='<a target="_blank">'
                        htmlStr+='<i class="iconfont ic-list-comments"></i>'+reply_num
                        htmlStr+='</a><span><i class="iconfont ic-list-like"></i>'+like_num+'</span>'
                        htmlStr+='</div>\n' +
                             '           </div>\n' +
                             '         </li>'
                        $(".note-list").append(htmlStr)
                    }
                }
            })

        })


    })
</script>